package com.yxw.job.task.livevodbackend;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yxw.live_vod_backend_facade.dto.AddVodUsageInformationDto;
import com.yxw.live_vod_backend_facade.feign.VodBackendFeignClient;
import com.yxw.live_vod_facade.feign.OnDemandFeignClient;
import com.yxw.yxnet_cd_center.common.utils.BaseDateTime;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 后台点播相关定时任务
 * liuxin
 * 2023.12.17
 */
@Component
@Slf4j
public class VodBackendTask {


    @Autowired
    private VodBackendFeignClient vodBackendFeignClient;

    /**
     * 点播点赞信息从redis添加到数据库
     * @param str
     * @return
     */
    @XxlJob("insertVodUsageInformationByDay")
    public ReturnT<String> insertVodUsageInformationByDay(String str) {
        log.info("---------定时任务查询点播视频用量（天维度）开始：--------" + BaseDateTime.getLongDateTimeString(new Date()));
        AddVodUsageInformationDto dto=new AddVodUsageInformationDto();
        vodBackendFeignClient.insertVodUsageInformationByDay(dto);
        log.info("---------定时任务查询点播视频用量（天维度）结束：--------" + BaseDateTime.getLongDateTimeString(new Date()));
        return ReturnT.SUCCESS;
    }

}
